POV-Ray : Newsgroups : povray.general : Fast poligonal solids? : Re: Fast poligonal solids? Server Time
8 Aug 2024 06:15:47 EDT (-0400)
  Re: Fast poligonal solids?  
From: Warp
Date: 5 May 2001 07:29:15
Message: <3af3e40b@news.povray.org>
Rich <SrP### [at] ricoswebcom> wrote:
: Do you have a dodecahedron mesh model I can try in my scene?

  Here is a unit-sized dodecahedron mesh definition ("unit-sized" meaning
that it fits inside a sphere of radius 1).
  The vertex coordinates were taken from this interesting page:
http://www.rwgrayprojects.com/rbfnotes/polyhed/polycoor.html

--------8<--------8<--------8<--------8<--------8<--------8<--------8<--------
#local p = (1+sqrt(5))/2; // the Golden ratio
#local p2 = pow(p,2);
#local p3 = pow(p,3);

#local Vert = array[20]
{ <0,p,p3>, <0,-p,p3>, <p2,p2,p2>, <-p2,p2,p2>,
  <-p2,-p2,p2>, <p2,-p2,p2>, <p3,0,p>, <-p3,0,p>,
  <p,p3,0>, <-p,p3,0>, <-p,-p3,0>, <p,-p3,0>,
  <p3,0,-p>, <-p3,0,-p>, <p2, p2, -p2>, <-p2,p2,-p2>,
  <-p2,-p2,-p2>, <p2,-p2,-p2>, <0,p,-p3>, <0,-p,-p3>
}
#local TInd = array[36]
{ <0,1,3><1,3,7><1,7,4><0,2,8><0,8,9><0,9,3>
  <2,6,12><2,12,14><2,14,8><3,7,13><3,13,15><3,15,9>
  <0,1,5><0,5,6><0,6,2><1,5,11><1,11,10><1,10,4>
  <7,13,16><7,16,10><7,10,4><9,8,14><9,14,18><9,18,15>
  <5,6,12><5,12,17><5,17,11><12,14,18><12,18,19><12,19,17>
  <10,11,17><10,17,19><10,19,16><13,15,18><13,18,19><13,19,16>
}

#version Unofficial MegaPov 0.6;
#declare DodecahedronMesh =
  mesh
  { #local Len = vlength(Vert[0]);
    #local I = 0;
    #while(I < 36)
      triangle{Vert[TInd[I].x]/Len, Vert[TInd[I].y]/Len, Vert[TInd[I].z]/Len}
      #local I = I+1;
    #end
    inside_vector y
  }
--------8<--------8<--------8<--------8<--------8<--------8<--------8<--------


-- 
#macro N(D,I)#if(I<6)cylinder{M()#local D[I]=div(D[I],104);M().5,2pigment{
rgb M()}}N(D,(D[I]>99?I:I+1))#end#end#macro M()<mod(D[I],13)-6,mod(div(D[I
],13),8)-3,10>#end blob{N(array[6]{11117333955,
7382340,3358,3900569407,970,4254934330},0)}//                     - Warp -


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.